from celery_task.tasks import add, low


# 添加延迟任务
from datetime import datetime, timedelta
def eta_second(second):
    ctime = datetime.now()
    utc_ctime = datetime.utcfromtimestamp(ctime.timestamp())
    time_delay = timedelta(seconds=second)
    return utc_ctime + time_delay

# 手动添加 延迟任务
if __name__ == '__main__':
    result = add.apply_async(args=(200, 50), eta=eta_second(10))
    print(result.id)
    result = low.apply_async(args=(200, 50), eta=eta_second(8))
    print(result.id)



